package com.tn.mqtt;

import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName MqttConfig
 * @Description TODO
 * @Author Yezhongzhu
 * @Date 2021/11/26 10:07
 * @Version v1.0
 **/
@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "mqtt")
public class MqttConfig {
    @Value("${mqtt.serverURIs}")
    private String host; //mqtt服务器的地址和端口号

    //@Value("${mqtt.clientId}")
    private String clientId="DC" + (int) (Math.random() * 100000000); // = "DC" + (int) (Math.random() * 100000000)

    @Value("${mqtt.username}")
    private String userName;

    @Value("${mqtt.password}")
    private String passWord;

    @Value("${mqtt.topic}")
    private String topic;
}
